﻿@{
    ViewBag.Title = "加工明细查询";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.nbGridFor<MaterialProcessItem>(s =>
 {
     s.ShowCheckBox(false);
     s.SummaryTemplate("加工数：<b>${ProcessWeight}</b> 斤，领料数：<b>${PickWeight}</b> 斤，入库数：<b>${StorageWeight}</b> 斤");
     s.layoutH(120);
     s.Action("DetailList");
     s.ExtParam(new { date = @DateTime.Today, State = "Storage" });
     s.Columns(c =>
     {
         c.Bind(e => e.Id).IsKey();
         c.BindDateTime(e => e.Date).AsSearch();
         c.Bind(e => e.Code).Width(70);
         c.Bind(e => e.Name).Width(50).AsQuery().AsSearch();
         c.Bind(e => e.RawMaterialName).Width(60).AsSearch();
         c.Bind(e => e.ProcessRate).Width(40).Align(GridAlign.Right).Align(GridAlign.Right).Process("FormatProcessRate");
         c.BindEnum(e => e.Category, "MaterialCategory").Width(60).AsSearch();
         c.Bind(e => e.ProcessWeight).Width(60).Align(GridAlign.Right).Summary(SummaryType.Sum);
         c.Bind(e => e.PickWeight).Width(60).Align(GridAlign.Right).Summary(SummaryType.Sum);
         c.Bind(e => e.StorageWeight).Width(70).Align(GridAlign.Right).Summary(SummaryType.Sum);
         c.BindEnum(e => e.State, "ProcessState").Width(70).AsSearch();
     });
 }))
 <script type="text/javascript">
     function FormatProcessRate(value, id, row) {
         if (value != '') {
             return value * 100 + "%";
         }
         return value;
     }
</script>
